import factory from '../serviceFactory'

class SystemService {
  /**
   * queryRolePage(page,pageSize,{sidx,sord,roleName})
   */
  queryRolePage = factory.makeQuery('role', 'Role')

  /**
   * detailRole({id})
   */
  detailRole = factory.makeDetail('role', 'Role')

  /**
   * addRole({roleName,roleDesc})
   */
  addRole = factory.makeAdd('role', 'Role')

  /**
   * deleteRole(id)
   */
  deleteRole = factory.makeDelete('role', 'Role')
  /**
   * deleteRole([...ids])
   */
  batchDeleteRole = factory.makeBatchDelete('role', 'Role')

  /**
   * updateRole({id,roleName,roleDesc})
   */
  updateRole = factory.makeUpdate('role', 'Role')

  /**
   * freezeUser({})
   */
  freezeUser = factory.makePost('/api/user/freezeUser')

  /**
   * queryUserPage(page,pageSize,{sidx,sord,param})
   */
  queryUserPage = factory.makeQuery('user', 'User')

  /**
   * queryUserList()
   */
  queryUserList = factory.makeGet('/api/user/queryUserList')

  /**
   * queryRoleList()
   */
  queryRoleList = factory.makeGet('/api/role/queryRoleList')

  /**
   * detailUser({id})
   */
  detailUser = factory.makeDetail('user', 'User')

  /**
   * addUser({})
   */
  addUser = factory.makeAdd('user', 'User')
  /**
   * deleteUser(id)
   */
  deleteUser = factory.makeDelete('user', 'User')
  /**
   * batchDeleteUser(ids)
   */
  batchDeleteUser = factory.makeBatchDelete('user', 'User')
  /**
   * updateUser({})
   */
  updateUser = factory.makeUpdate('user', 'User')
  /**
   * addDept({deptName, parentId})
   */
  addDept = factory.makeAdd('sys', 'Dept')
  /**
   * resetPassword(id)
   */
  resetPassword = factory.makePost('/api/user/resetPassword')
  /**
   * updatePassword({})
   */
  updatePassword = factory.makePost('/api/personal/modifyPassword')
  /**
   * delDept(id)
   */
  delDept = factory.makeDelete('department', 'Department')
  /**
   * queryDeptTree({deptName})
   */
  queryDeptTree = factory.makeGet('/api/department/queryDepartmentTree')
  /**
   * queryDeptList()
   */
  queryDeptList = factory.makeGet('/api/department/getDepartmentOptions')
  /**
   * saveDept({deptName,parentId,deptId})
   */
  saveDept = factory.makePost('/api/department/saveDept')
  /**
   * queryResourceTree({resName})
   */
  queryResourceTree = factory.makeGet('/api/resource/queryResourceTree')
  /**
   * queryResourcePage(page,pageSize,{sidx,sord,resName})
   */
  queryResourcePage = factory.makeQuery('resource', 'Resource')
  /**
   * addResource({form})
   */
  addResource = factory.makeAdd('resource', 'Resource')
  /**
   * queryResourceList()
   */
  queryResourceList = factory.makeGet('/api/resource/getResourceOptions')
  /**
   * delResource(id)
   */
  delResource = factory.makeDelete('resource', 'Resource')
  /**
   * batchDeleteResource(ids)
   */
  batchDeleteResource = factory.makeBatchDelete('resource', 'Resource')
  /**
   * updateResource({})
   */
  updateResource = factory.makeUpdate('resource', 'Resource')

  /**
   * queryGroupPage(page,pageSize,{sidx,sord,param})
   */
  queryGroupPage = factory.makeQuery('group', 'Group')

  /**
   * addGroup({form})
   */
  addGroup = factory.makeAdd('group', 'Group')

  /**
   * updateGroup({id,name,desc})
   */
  updateGroup = factory.makeUpdate('group', 'Group')

  /**
   * deleteRole(id)
   */
  deleteGroup = factory.makeDelete('group', 'Group')
  /**
   * deleteRole([...ids])
   */
  batchDeleteGroup = factory.makeBatchDelete('group', 'Group')

  /**
   * getMembers(organizationId)
   */
  getGroupMembers = factory.makeGet('/api/group/getMembers')

  /**
   * addGroupMembers({organizationId,[...ids],[...deleteIds]})
   */
  addGroupMembers = factory.makeAdd('group', 'Members')

  /**
   * setGroupLeaders({organizationId,[...ids]})
   */
  setGroupLeaders = factory.makePost('/api/group/setLeaders')

  /**
   * getUserByIdentityCode({identityCode})
   */
  getUserByIdentityCode = factory.makeGet('/api/user/getUserByIdentityCode')

  /**
   * queryTimeExtraPage(page,pageSize,{sidx,sord,param})
   */
  queryTimeExtraPage = factory.makeQuery('user', 'TimeExtra')

  /**
   * editTimeExtra({userId,updateHours})
   */
  editTimeExtra = factory.makePost('/api/user/editTimeExtra')

  /**
   * queryAllDictTypePage({})
   */
  queryAllDictTypePage = factory.makeQuery('dictType', 'AllDictType')

  /**
   * addDictType({})
   */
  addDictType = factory.makeAdd('dictType', 'DictType')

  /**
   * detailDictType({id})
   */
  detailDictType = factory.makeDetail('dictType', 'DictType')

  /**
   * updateDictType({})
   */
  updateDictType = factory.makeUpdate('dictType', 'DictType')

  /**
   * deleteDictType(id)
   */
  deleteDictType = factory.makeDelete('dictType', 'DictType')

  /**
   * freezeDictType({})
   */
  freezeDictType = factory.makePost('/api/dictType/freezeDictType')

  /**
   * queryAllDictDataPage({})
   */
  queryAllDictDataPage = factory.makeQuery('dict', 'AllDictData')

  /**
   * addDictData({})
   */
  addDictData = factory.makeAdd('dict', 'DictData')

  /**
   * detailDictData({id})
   */
  detailDictData = factory.makeDetail('dict', 'DictData')

  /**
   * updateDictData({})
   */
  updateDictData = factory.makeUpdate('dict', 'DictData')

  /**
   * deleteDictData(id)
   */
  deleteDictData = factory.makeDelete('dict', 'DictData')

  /**
   * freezeDictData({})
   */
  freezeDictData = factory.makePost('/api/dict/freezeDictData')

  /**
   * batchDeleteDictData([])
   */
  batchDeleteDictData = factory.makeBatchDelete('dict', 'DictData')

  /**
   * getLeaveDuration({leaveType, beginTime,endTime})
   * then {duration,unit}
   */
  getLeaveDuration = factory.makeGet('/api/sys/leaveDuration')

  queryQuarzTask = factory.makeGet('/api/quartz/qryQuartzTask')
  saveQuartzTask = factory.makePost('/api/quartz/saveQuartzTask')
  delWithQuarzTask = factory.makePost('/api/quartz/delWithQuarzTask')
  getTaskDetail = factory.makeGet('/api/quartz/getTaskDetail')
  qryQrtzRunlog = factory.makeGet('/api/quartzlog/qryQrtzRunlog')
  getQuartzLogDetail = factory.makeGet('/api/quartzlog/getLogDetail')

  /**
   * 获取当前系统时间
   */
  now = factory.makeGet('/api/sys/now')
}

export default new SystemService()
